﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.FactoryManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.FactoryManagement.EncodeItemVMs
{
    public partial class EncodeItemTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._EncodeItem._Pos")]
        public ExcelPropety Pos_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.Pos);
        [Display(Name = "_Model._EncodeItem._ValueName")]
        public ExcelPropety ValueName_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.ValueName);
        [Display(Name = "_Model._EncodeItem._ValueMode")]
        public ExcelPropety ValueMode_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.ValueMode);
        [Display(Name = "_Model._EncodeItem._Value")]
        public ExcelPropety Value_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.Value);
        [Display(Name = "_Model._EncodeItem._Remark")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.Remark);
        [Display(Name = "_Model._EncodeItem._Scheme")]
        public ExcelPropety Scheme_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.SchemeId);
        [Display(Name = "_Model._EncodeItem._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.CreateTime, true);
        [Display(Name = "_Model._EncodeItem._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.UpdateTime, true);
        [Display(Name = "_Model._EncodeItem._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.CreateBy);
        [Display(Name = "_Model._EncodeItem._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.UpdateBy);
        [Display(Name = "_Model._EncodeItem._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.IsValid);
        [Display(Name = "_Model._EncodeItem._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<EncodeItem>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Scheme_Excel.DataType = ColumnDataType.ComboBox;
            Scheme_Excel.ListItems = DC.Set<EncodeScheme>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class EncodeItemImportVM : BaseImportVM<EncodeItemTemplateVM, EncodeItem>
    {
            //import

    }

}